package cn.tanghom.app.oa.model;

import java.util.Date;

import org.springframework.data.jpa.domain.AbstractPersistable;

import com.unbiz.common.lang.BaseObject;

/**
 * 请假任务
 * @author Hunteron-cp
 *
 */
public class LeaveTask extends AbstractPersistable<Long>{	
	String process_instance_id;
	String user_id;
	Date start_time;
	Date end_time;
	String leave_type;
	String reason;
	Date apply_time;
	Date reality_start_time;
	Date reality_end_time;
	String taskid;
	String taskname;
	String processinstanceid;
	String processdefid;
	Date taskcreatetime;
	
	public LeaveTask(){
		
	}
	
	public LeaveTask(Leave apply){
		LeaveTask task = this;
		task.setApply_time(apply.getApplyTime());
		task.setUser_id(apply.getUserId());
		task.setEnd_time(apply.getEndTime());
		task.setId(apply.getId());
		task.setLeave_type(apply.getLeaveType());
		task.setProcess_instance_id(apply.getProcessInstanceId());
		
		task.setReason(apply.getReason());
		task.setStart_time(apply.getStartTime());
		
		if(apply.getTask()!=null){
			task.setProcessdefid(apply.getTask().getProcessDefinitionId());
			task.setTaskcreatetime(apply.getTask().getCreateTime());
			task.setTaskid(apply.getTask().getId());
			task.setTaskname(apply.getTask().getName());		
		}		
	}	
	
	public String getProcess_instance_id() {
		return process_instance_id;
	}
	public void setProcess_instance_id(String process_instance_id) {
		this.process_instance_id = process_instance_id;
	}
	public String getUser_id() {
		return user_id;
	}
	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}
	public Date getStart_time() {
		return start_time;
	}
	public void setStart_time(Date start_time) {
		this.start_time = start_time;
	}
	public Date getEnd_time() {
		return end_time;
	}
	public void setEnd_time(Date end_time) {
		this.end_time = end_time;
	}
	public String getLeave_type() {
		return leave_type;
	}
	public void setLeave_type(String leave_type) {
		this.leave_type = leave_type;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	public Date getApply_time() {
		return apply_time;
	}
	public void setApply_time(Date apply_time) {
		this.apply_time = apply_time;
	}
	public Date getReality_start_time() {
		return reality_start_time;
	}
	public void setReality_start_time(Date reality_start_time) {
		this.reality_start_time = reality_start_time;
	}
	public Date getReality_end_time() {
		return reality_end_time;
	}
	public void setReality_end_time(Date reality_end_time) {
		this.reality_end_time = reality_end_time;
	}
	public String getTaskid() {
		return taskid;
	}
	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}
	public String getTaskname() {
		return taskname;
	}
	public void setTaskname(String taskname) {
		this.taskname = taskname;
	}
	public String getProcessinstanceid() {
		return processinstanceid;
	}
	public void setProcessinstanceid(String processinstanceid) {
		this.processinstanceid = processinstanceid;
	}
	public String getProcessdefid() {
		return processdefid;
	}
	public void setProcessdefid(String processdefid) {
		this.processdefid = processdefid;
	}
	public Date getTaskcreatetime() {
		return taskcreatetime;
	}
	public void setTaskcreatetime(Date taskcreatetime) {
		this.taskcreatetime = taskcreatetime;
	}
	
	
}
